<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表单修饰符</title>
		<script src="../js/vue.js"></script>
		<style type="text/css">
			[v-cloak]{
				display: none;
			}
		</style>
	</head>
	<body>
		<div id="app" v-cloak>
			数字1：<input type="text" v-model="num1" /><br />
			数字2：<input type="text" v-model="num2" /><br />
			<button @click="addNum()">加法操作</button><br />
			总数：{{count}}
			<hr />
			
			数据：<input type="text" v-model.trim="msg" /><br />
			字符长度：{{msg.length}}
			
			<hr />
			检验用户名：<input type="text" v-model.lazy="username" /><br />
			{{username}}
		</div>
		
	</body>
	<script>
		const app = new Vue({
			el:"#app",
			data:{
				num1:'',
				num2:'',
				count:'',
				msg:'',
				username:''
			},
			methods:{
				addNum(){
					this.count=parseInt(this.num1)+parseInt(this.num2)
				}
			}
		})
	</script>
</html>
